class CreateGadgets < ActiveRecord::Migration
  def self.up
    create_table :gadgets do |t|
      t.string      :spec_url
      t.string      :container_id
      t.string      :title
      t.text        :description
      t.references  :category
      t.boolean     :published
      
      t.string      :photo_file_name # Original filename
      t.string      :photo_content_type # Mime type     
      t.integer     :photo_file_size # File size in bytes
      
      t.string      :gadget_spec_file_name # Original filename
      t.string      :gadget_spec_content_type # Mime type     
      t.integer     :gadget_spec_file_size # File size in bytes
    
      t.timestamps
    end
    
    Gadget.load
                  
  end

  def self.down
    drop_table :gadgets
  end
end
